package com.quick.api.config;

import org.springframework.boot.context.properties.ConfigurationProperties;
import org.springframework.stereotype.Component;

import java.util.List;

/**
 * @author ：chicunxiang
 * @date ：Created in 2021/3/25 14:08
 * @description：
 * @version: 1.0
 */
@Component
@ConfigurationProperties(prefix = "db")
public class DataSourceConfiguration {

    private List<DataSourceConfigProxy> datasource;
    private String primary;

    public List<DataSourceConfigProxy> getDatasource() {
        return datasource;
    }

    public void setDatasource(List<DataSourceConfigProxy> datasource) {
        this.datasource = datasource;
    }

    public String getPrimary() {
        return primary;
    }

    public void setPrimary(String primary) {
        this.primary = primary;
    }

    public static class DataSourceConfigProxy {
        private String alias;
        private String url;
        private String username;
        private String password;
        private String type;
        private String driverClassName;
        private String mapperLocations;

        public String getMapperLocations() {
            return mapperLocations;
        }

        public void setMapperLocations(String mapperLocations) {
            this.mapperLocations = mapperLocations;
        }

        public String getAlias() {
            return alias;
        }

        public void setAlias(String alias) {
            this.alias = alias;
        }

        public String getUrl() {
            return url;
        }

        public void setUrl(String url) {
            this.url = url;
        }

        public String getUsername() {
            return username;
        }

        public void setUsername(String username) {
            this.username = username;
        }

        public String getPassword() {
            return password;
        }

        public void setPassword(String password) {
            this.password = password;
        }

        public String getType() {
            return type;
        }

        public void setType(String type) {
            this.type = type;
        }

        public String getDriverClassName() {
            return driverClassName;
        }

        public void setDriverClassName(String driverClassName) {
            this.driverClassName = driverClassName;
        }
    }

}
